package com.lin.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.lin.entity.GroupInformation;
import com.lin.entity.ProjectDetail;
import com.lin.mapper.GroupInformationMapper;
import com.lin.security.util.SecurityUtil;
import com.lin.service.GroupInformationService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lin.service.ProjectDetailService;
import com.lin.service.TalentJoinService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 林伟鸿
 * @since 2022-04-16
 */
@Service
public class GroupInformationServiceImpl extends ServiceImpl<GroupInformationMapper, GroupInformation> implements GroupInformationService {


    @Resource
    ProjectDetailService projectDetailService;


    @Override
    public GroupInformation queryGroupInfo(String projectId) {
        if (projectDetailService.getById(projectId) == null || projectId == null) {
            throw new RuntimeException("查询的项目不存在!");
        }
        int currentUserUid = SecurityUtil.getCurrentUserUid();
        ProjectDetail projectDetail = projectDetailService.getById(projectId);
        return this.getById(projectDetail.getGroupId());
    }
}
